﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="SalaryRulesInputFields.ascx.cs"
    Inherits="SERP.Modules.SalaryRules.SalaryRulesInputFields" %>
<%@ Register Src="CalculationTypes.ascx" TagName="CalculationTypes" TagPrefix="uc1" %>
<%@ Register Src="../SalaryFields/DropDownListSalaryFields.ascx" TagName="DropDownListSalaryFields"
    TagPrefix="uc2" %>
<div class="fgroup">
    <asp:Label runat="server" ID="lblInfo"></asp:Label>
</div>
<div class="frow">
    <asp:Label ID="labelRuleName" runat="server" Text="RuleName" CssClass="label" EnableViewState="False"></asp:Label>
    <asp:TextBox runat="server" ID="txtRuleName" Width="400"></asp:TextBox>
</div>
<div class="frow">
    <asp:Label ID="labelStatus" runat="server" Text="Status" CssClass="label" EnableViewState="False"></asp:Label>
    <asp:TextBox runat="server" ID="txtStatus" MaxLength="4" Width="50"></asp:TextBox>
    <asp:RegularExpressionValidator ID="validExpressionStatus" Display="dynamic" runat="server"
        ControlToValidate="txtStatus" ErrorMessage="*dữ liệu dạng số nguyên" ValidationExpression="^\d+$"
        ValidationGroup="btnSave"></asp:RegularExpressionValidator>
    <asp:RequiredFieldValidator ID="validRQStatus" ValidationGroup="btnSave" Text=""
        runat="server" ErrorMessage="* không được để trống" Display="dynamic" ControlToValidate="txtStatus"></asp:RequiredFieldValidator>
    <asp:Label ID="labelFromDay" runat="server" Text="FromDay" CssClass="label" EnableViewState="False"></asp:Label>
    <asp:TextBox runat="server" ID="txtFromDay" MaxLength="8" Width="50"></asp:TextBox>
    <asp:RegularExpressionValidator ID="validExpressionFromDay" Display="dynamic" runat="server"
        ControlToValidate="txtFromDay" ErrorMessage="*dữ liệu dạng số nguyên" ValidationExpression="^(\+|-)?\d+$"
        ValidationGroup="btnSave"></asp:RegularExpressionValidator>
    <asp:RequiredFieldValidator ID="validRQFromDay" ValidationGroup="btnSave" Text=""
        runat="server" ErrorMessage="* không được để trống" Display="dynamic" ControlToValidate="txtFromDay"></asp:RequiredFieldValidator>
    <asp:Label ID="labelToDay" runat="server" Text="ToDay" CssClass="label" EnableViewState="False"></asp:Label>
    <asp:TextBox runat="server" ID="txtToDay" MaxLength="8" Width="50"></asp:TextBox>
    <asp:RegularExpressionValidator ID="validExpressionToDay" Display="dynamic" runat="server"
        ControlToValidate="txtToDay" ErrorMessage="*dữ liệu dạng số nguyên" ValidationExpression="^(\+|-)?\d+$"
        ValidationGroup="btnSave"></asp:RegularExpressionValidator>
    <asp:RequiredFieldValidator ID="validRQToDay" ValidationGroup="btnSave" Text="" runat="server"
        ErrorMessage="* không được để trống" Display="dynamic" ControlToValidate="txtToDay"></asp:RequiredFieldValidator>
</div>
<div class="frow" style="height:60px">
    <asp:Label ID="labelNote" runat="server" Text="Note" CssClass="label" EnableViewState="False"></asp:Label>
    <asp:TextBox runat="server" ID="txtNote" Width="400" TextMode="MultiLine" Height="50px"></asp:TextBox>
</div>
<div class="fgroup">
    <asp:Label runat="server" ID="lblItem"></asp:Label>
    <asp:Button ID="btnAdd" runat="server" Text="Add" OnClick="btnAdd_Click" />
</div>
<table class="grid">
    <tr>
        <td class="tblhleft" style="width: 34px">
            <%=SERP.Constants.APP_INDEX%>
        </td>
        <td class="tblh">
            <%=SERP.StringMappings.SalaryRuleItemsStringMapping.RuleContent%>
        </td>
        <td class="tblh" style="width: 80px">
            <%=SERP.StringMappings.SalaryRuleItemsStringMapping.CalculationType%>
        </td>
        <td class="tblh" style="width: 80px">
            <%=SERP.StringMappings.SalaryRuleItemsStringMapping.SalaryFieldId%>
        </td>
        <td class="tblh" style="width: 80px">
            <%=SERP.StringMappings.SalaryRuleItemsStringMapping.CalculationIndex%>
        </td>
        <td class="tblh" style="width: 30px; text-align: center">
            <%=SERP.Constants.APP_DELETE%>
        </td>
    </tr>
    <asp:Repeater runat="server" ID="gridData">
        <ItemTemplate>
            <tr>
                <td class="tblcleft">
                    <asp:Label runat="server" ID="lblID" Visible="false" Text='<%#Eval("SalaryRuleItemId")%>'></asp:Label>
                    <%#Container.ItemIndex+1%>
                </td>
                <td class="tblc">
                    <asp:TextBox ID="txtContent" Text='<%#Eval("RuleContent")%>' Width="99%" runat="server"
                        TextMode="MultiLine"></asp:TextBox>
                </td>
                <td class="tblc">
                    <uc1:CalculationTypes ID="txtCalculationType" SelectedValue='<%#Eval("CalculationType")%>'
                        runat="server" />
                </td>
                <td class="tblc">
                    <uc2:DropDownListSalaryFields ID="txtSalaryFieldId" Width="99%" SelectedValue='<%#Eval("SalaryFieldId") %>'
                        runat="server" />
                </td>
                <td class="tblc">
                    <asp:TextBox ID="txtIndex" runat="server" Text='<%#Eval("CalculationIndex")%>' TextMode="SingleLine"
                        Width="100"></asp:TextBox>
                </td>
                <td class="tblc" style="text-align: center">
                    <asp:LinkButton ID="btnXoa" runat="server" CommandArgument='<%#Container.ItemIndex%>'
                        OnCommand="btnXoa_OnCommand">
                        <asp:Image ID="imgDelete" runat="server" Style="border: 0" ImageUrl="~/App_Themes/Default/img/delete.jpg" />
                    </asp:LinkButton>
                </td>
            </tr>
        </ItemTemplate>
    </asp:Repeater>
</table>
